package com.crl.module.npc.action
{
	import com.crl.module.npc.controller.INpcLogic;
	
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;
	
	
	/**
	 * 抽像npc脚本动作;
	 * @author crl
	 * 
	 */	
	public class AbstractAction implements IAction
	{
		protected var npc:INpcLogic;
		protected var type:String;
		public function AbstractAction(npc:INpcLogic)
		{
			this.npc=npc;
		}

		public function parseXML(xml:XML):void
		{
		}
		
		public function getType():String
		{
			return this.type;
		}
		
		public function execute():void
		{
			throw new Error("子类重写");
		}
		
		public function clone():IAction{
			var className:String=getQualifiedClassName(this);
			var classRef:Class=getDefinitionByName(className)as Class;
			return new classRef(this.npc);
		}
		
	}
}